package org.raymond.iworks.study.orders.entity;

import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import org.raymond.iworks.repository.entity.AbstractEntity;

import java.math.BigDecimal;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded=true, callSuper = false)
@Entity
@Table(name="t_order_items")
public class TOrderItems extends AbstractEntity {
    @EqualsAndHashCode.Include
    @Id
    @GenericGenerator(name = ID_GENERATOR_NAME, strategy = ID_GENERATOR)
    @GeneratedValue(generator = ID_GENERATOR_NAME)
    private Long id;
    @Column(name="order_id")
    private Long orderId;
    @Column(name="product_id")
    private Long productId;
    @Column(name="product_name")
    private String productName;
    @Column(name="product_unit_price")
    private BigDecimal productUnitPrice;
    @Column(name="product_num")
    private Integer productNum;
    @Column(name="item_price")
    private BigDecimal itemPrice;
}
